1. Technology Field
The present invention relates to a data processing method of a memory storage apparatus. Particularly, the present invention relates to a data processing method capable of preventing a pre-stored file from being overwritten after a memory storage apparatus is formatted, and a memory controller and a memory storage apparatus using the same.
2. Description of Related Art
Digital cameras, cell phones, and MP3 players have undergone rapid growth in recent years, so that consumer demands for storage media have also rapidly increased. Since a rewritable non-volatile memory (for example, a flash memory) has characteristics such as data non-volatility, low power consumption, small volume, and non-mechanical structure, etc., it is suitable for various aforementioned potable multimedia devices.
Particularly, as electronic wallets and pre-payments are gradually accepted by users, smart cards are widely used. The smart card is an integrated circuit chip (IC chip) having components such as a microprocessor, a card operating system, a security module and a memory etc. for performing a predetermined operation. The smart card provides functions of calculation, encryption, two-way communication and security, so that besides data storage, the smart card may provide a protection for the data stored therein. A subscriber identification module (SIM) card utilized in a cell phone applying a global system for mobile communication (GSM) is an application example of the smart card. However, since storage volumes of the smart cards are limited, memory cards with large volume are combined to the smart cards recently for increasing the storage volumes of the smart cards.
In a memory storage apparatus having a smart card chip, in order to implement command and data transmission between the smart card chip and a host system, according to an existing technique, a memory controller of the memory storage apparatus pre-stores a communication file in a rewritable non-volatile memory combined to the smart card in the memory storage apparatus, and uses the communication file as a communication interface between the smart card and the host system. In detail, each time when the memory storage apparatus is formatted to generate a partition, the memory controller of the memory storage apparatus stores a communication file in the partition, and records information of the communication file in a file system. Then, when an application program of the host system is to transmit a command to the smart card chip of the memory storage apparatus, the application program transmits a write command that indicates writing data to a logical address used for storing the communication file to the memory storage apparatus. Particularly, the memory controller identifies a data stream in the write command to be belonged to the smart card chip according to the logical address in the write command, and transmits the data stream to the smart card chip.
However, after the memory storage apparatus is formatted, when the host system executes a writing operation before rereading the information of the file system of the memory storage apparatus, since the file system information temporarily stored in a buffer memory of the host system does not include the information of the communication file, the host system probably writes data to an address used for storing the communication file, which may cause overwriting of the communication file. Therefore, it is an important issue under development to avoid overwriting the communication file after the memory storage apparatus is formatted and before the host system rereading the information of the file system of the memory storage apparatus.
Nothing herein should be construed as an admission of knowledge in the prior art of any portion of the present invention. Furthermore, citation or identification of any document in this application is not an admission that such document is available as prior art to the present invention, or that any reference forms a part of the common general knowledge in the art.